package com.filetransfer.api;
import com.filetransfer.api.generated.invoker.ApiClient;
import com.filetransfer.config.UserThemeConfiguration;
import de.exlll.configlib.YamlConfigurations;
import lombok.extern.slf4j.Slf4j;

import static com.filetransfer.Main.CONFIG_FILE_PATH;
@Slf4j
public class ApiHelper {
    public static ApiClient newApiClient() {
        UserThemeConfiguration config = YamlConfigurations.update(CONFIG_FILE_PATH, UserThemeConfiguration.class);
        var client = new ApiClient();
        log.info("Server address: {}", config.getServerAddress());
        client.setBasePath(config.getServerAddress());
        return client;
    }
}
